package com.wafersystems.springbootdemo.feign.impl;

import com.pig4cloud.pigx.common.core.util.R;
import com.wafersystems.springbootdemo.feign.RemoteAdminService;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


/**
 * feign fallback demo
 * @author tandk
 * @date 2019/3/1
 */
@Slf4j
@Component
public class RemoteAdminServiceFallbackImpl implements RemoteAdminService {
  @Setter
  private Throwable cause;

  /**
   * 参数feign调用
   *
   * @param name 名称
   * @return R
   */
  @Override
  public R<String> feign(String name, String from) {
    log.error("feign 调用失败，name:{}", name, cause);
    return R.<String>builder().data("hello").build();
  }
}
